<?php
class Admin_AjaxController extends Zend_Controller_Action {
	function preDispatch() {
		$this->_helper->layout->disableLayout ();
		$this->_helper->viewRenderer->setNoRender ( true );
	}
	public function init() {
		$layoutPath = APPLICATION_PATH . '/templates/admin';
		$options = array (
				'layout' => 'index',
				'layoutPath' => $layoutPath 
		);
		Zend_Layout::startMvc ( $options );
	}
	public function getgroupuserAction() {
		$json = array (
				'STATUS' => 0 
		);
		$requests = $this->getRequest ()->getParams ();
		$GroupUser = UserGroup::getById ( $requests ['id'] );
		if ($GroupUser) {
			$json [] = $GroupUser->toArray ();
			$json ['STATUS'] = 1;
		}
		header ( 'Content-type: application/json' );
		echo json_encode ( $json );
	}
	public function getpermissionAction() {
		$json = array (
				'STATUS' => 0 
		);
		$requests = $this->getRequest ()->getParams ();
		$Permission = Permission::getById ( $requests ['id'] );
		if ($Permission) {
			$json [] = $Permission->toArray ();
			$json ['STATUS'] = 1;
		}
		header ( 'Content-type: application/json' );
		echo json_encode ( $json );
	}
	public function getuserAction() {
		$json = array (
				'STATUS' => 0 
		);
		$requests = $this->getRequest ()->getParams ();
		$User = Users::getById ( $requests ['id'] );
		if ($User) {
			$json [] = $User->toArray ();
			$json ['STATUS'] = 1;
		}
		header ( 'Content-type: application/json' );
		echo json_encode ( $json );
	}
	public function getmemberAction() {
		$json = array (
				'STATUS' => 0 
		);
		$requests = $this->getRequest ()->getParams ();
		$Member = Member::getById ( $requests ['id'] );
		if ($Member) {
			$json [] = $Member->toArray ();
			$json ['STATUS'] = 1;
		}
		header ( 'Content-type: application/json' );
		echo json_encode ( $json );
	}
	public function getcategoriesAction() {
		$json = array (
				'STATUS' => 0
		);
		$requests = $this->getRequest ()->getParams ();
		$Categories = Categories::getById ( $requests ['id'] );
		if ($Categories) {
			$json [] = $Categories->toArray ();
			$json ['STATUS'] = 1;
		}
		header ( 'Content-type: application/json' );
		echo json_encode ( $json );
	}
	public function getsliderAction() {
		$json = array (
				'STATUS' => 0
		);
		$requests = $this->getRequest ()->getParams ();
		$Slider = Sliders::getById ( $requests ['id'] );
		if ($Slider) {
			$json [] = $Slider->toArray ();
			$json ['STATUS'] = 1;
		}
		header ( 'Content-type: application/json' );
		echo json_encode ( $json );
	}
}







